package com.romotc.json.tools;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Iterator;
import java.util.Map;

import org.json.JSONObject;

import com.romotc.qqrobot.webqq.bean.Poll2_ResponseBody;

public class TestContent {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		FileReader fileReader = new FileReader(new File("d:\\json.txt"));
		BufferedReader bReader = new BufferedReader(fileReader);
		String content = bReader.readLine();
		JSONObject json = new JSONObject(content);
		Iterator iterator = json.keys();
		while(iterator.hasNext()) {
			
			String key = (String)iterator.next();
			Object value = json.get(key);
			System.out.println(value);
		}
		
		Poll2_ResponseBody m = Jackson.getObjectMaper().readValue(content, Poll2_ResponseBody.class);
		System.out.println(m);
		
		Object object = null;
		System.out.println(object instanceof String);
	}
	
	
	/**
{"retcode":0,
	"result":[
				{"poll_type":"message",
					"value":{"msg_id":15155,
								"from_uin":1562444454,"to_uin":1586030808,"msg_id2":490405,"msg_type":9,
								"reply_ip":176752342,"time":1327043011,
								"content":[
											["font",{"size":13,"color":"000000","style":[0,0,0],"name":"\u9ED1\u4F53"}],
											["cface","C98C5D9B33306040DBAEA163D4BDF147.jpg",""],
											["cface","73A1029B6C7F8D351DAA6D10F9EB2FBB.jpg",""],
											" "
										  ]
							 }
				 }
			]
}

	 * @author Administrator
	 *
	 */


}
